package com.smart.car.finance.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Random;

/**
 * 停车费支付账单表
 *
 * @author zoutao.blog.csdn.net
 * @date 2021/5/7
 */
@Data
@ApiModel("停车费支付账单表")
public class FinanceBill implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 账单id
     */
    @ApiModelProperty("账单id")
    private String id;

    /**
     * 支付金额
     */
    @ApiModelProperty("支付金额")
    private Float fee;

    /**
     * 车牌号
     */
    @ApiModelProperty("车牌号")
    private String plateNum;

    /**
     * 停车时长
     */
    @ApiModelProperty("停车时长")
    private Float duration;

    /**
     * 创建人
     */
    @ApiModelProperty("创建人")
    private String createBy;

    /**
     * 创建日期
     */
    @ApiModelProperty("创建日期")
    private Date createDate;

    /**
     * 更新人
     */
    @ApiModelProperty("更新人")
    private String updateBy;

    /**
     * 更新日期
     */
    @ApiModelProperty("更新日期")
    private Date updateDate;

    /**
     * 备注
     */
    @ApiModelProperty("备注")
    private String remark;

    /**
     * 版本号
     */
    @ApiModelProperty("版本号")
    private Integer version;

    /**
     * 状态
     */
    @ApiModelProperty("状态")
    private Integer state;

    public static void main(String[] args) {
        int n = 11;
        Random random = new Random();
        for (int i = 1; i < 100; i++) {
            int i1 = random.nextInt(n);
            System.out.println(i1);
        }
    }
}

class Calculate {
    static ThreadLocal<Integer> localVar = new ThreadLocal<>();

    public static void main(String[] args) {
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 10; i++) {
                    localVar.set((localVar.get() == null ? 0 : localVar.get()) + 1);
                }
                System.out.println(localVar.get());
            }
        });
        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 10; i++) {
                    localVar.set((localVar.get() == null ? 0 : localVar.get()) - 1);
                }
            }
        });
        t1.start();
        t2.start();
    }
}
